<template>
  <div>
    <el-button type="primary" @click="addShangchuan">数据上传</el-button>
    <ExcenDialog :isShowDoalog="isShowDoalog" @closeDialog="closeDialog" />
    <div class="table_box">
      <el-table
        :data="shujvList"
        style="width: 100%"
        height="100%"
        :row-class-name="tableRowClassName"
        stripe
      >
        <el-table-column prop="projectName" label="项目名称" width="180" />
        <el-table-column prop="projectConstructionUnit" label="建设单位" />
        <el-table-column prop="projectConstructionContent" label="项目概况" />
        <el-table-column prop="projectConstructionLocation" label="所属片区" />
        <el-table-column prop="projectPlanDate" label="计划工期" />
        <el-table-column prop="projectUseDate" label="投用时间" />
        <el-table-column prop="provideDegrees" label="提供学位" />
        <el-table-column prop="projectIsApproval" label="否立项" />
      </el-table>
    </div>
  </div>
</template>
<script setup>
import ExcenDialog from "./components/ExcenDialog.vue"
import { getPopupAwaitProjectListByGradeAPI } from "@/api/school.js"
import { ref, onMounted } from "vue"
onMounted(() => {
  init()
})
const shujvList = ref([])
const init = async () => {
  let data = {
    region: "",
    approval: "",
    pageNum: 1,
    pageSize: 100000
  }
  const res = await getPopupAwaitProjectListByGradeAPI(data)
  console.log(res)
  shujvList.value = res.data
}
const isShowDoalog = ref(false)
const addShangchuan = () => {
  isShowDoalog.value = true
}
const closeDialog = () => {
  isShowDoalog.value = false
  init()
}
const tableRowClassName = ({ row, rowIndex }) => {
  return "success-row" //这是类名
}
</script>
<style scoped lang="less">
/deep/.success-row {
  height: 60px !important;
  overflow: hidden;
}
.table_box {
  width: 100%;
  height: 85vh;
}
</style>
